<meta charset="UTF-8">

<?php

include_once("functions/db_manipulate.php");
if (!init()) {
    redirect('login.php');
}

$link_id = connectDB();

startTransaction();

$resultSet = mysql_query("INSERT INTO usrtopic(uid, tid) VALUES ('" . $_SESSION['id'] . "','" . mysql_real_escape_string($_GET['tid']) . "') ");

if ($resultSet) {
    commitTransaction();
} else {
    rollbackTransaction();
}
redirect($_SERVER['HTTP_REFERER']);
?>